package com.woniuxy.controller;

import com.woniuxy.entity.RbacMenu;
import com.woniuxy.entity.ResponseEntity;
import com.woniuxy.service.RbacMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Todo: 我们菜单使用的controller
 **/
@RestController
@RequestMapping("rbacMenu")
public class RbacMenuController {
    @Autowired
    RbacMenuService rbacMenuService;
    @RequestMapping("getAllMenu")
    public ResponseEntity getAllMenu(){
        return rbacMenuService.findAll();
    }
    @GetMapping("updateMenu/{fid}/{id}")
    public ResponseEntity updateMenu(@PathVariable("fid") int fid,@PathVariable("id") int id){
        return rbacMenuService.updateMenu(fid,id);
    }
    @PostMapping("updateOne")
    public ResponseEntity updateOne(@RequestBody RbacMenu rbacMenu){
        return rbacMenuService.updateOne(rbacMenu);
    }
}
